/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package view.GUI.sidepanels;

import java.awt.Color;
import java.awt.Component;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.table.TableCellRenderer;
import model.graphic.locations.Location;
import view.GUI.LabelReader;

/**
 *
 * @author Arfeniel
 */
public class LocationRenderer extends JLabel implements TableCellRenderer {
    public LocationRenderer() {
        setOpaque(true);
    }

    public Component getTableCellRendererComponent(JTable table, Object obj, boolean isSelected, boolean hasFocus, int row, int column) {
        Location loc = (Location)obj;
        setToolTipText(LabelReader.getInstance().getString("LocationValue")+": "
                       + loc.getX() + ", "  + loc.getY());
        setBackground(Color.WHITE);
        setText(loc.getX()+", "+loc.getY());
        return this;
    }
}


